package com.web.jdbcyw1.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.web.jdbcyw1.module.User;
import com.web.jdbcyw1.service.UserService2;

@Controller
@RequestMapping("/user2")
public class UserController2 {
	@Resource
	private UserService2 UserServiceImpl;
	@RequestMapping("/getUserList2.br")
	@ResponseBody
	//http://localhost:9081/springMvc/user2/getUserList2.br
	public List<User> queryUser() {
		System.out.println(123);
		User u = new User();
		return UserServiceImpl.queryUser(u);
	}
	
	@RequestMapping("/addUser2")
	@ResponseBody
	public int addUser() {
		User user = new User();
		user.setName("123teswt");
		user.setPwd("12pwd的");
		return UserServiceImpl.addUser(user);
	}
	
}
